package com.yykt.myapp.filter;

import lombok.extern.slf4j.Slf4j;

import javax.annotation.processing.Filer;
import javax.servlet.*;
import java.io.IOException;

@Slf4j
public class AppFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException, ServletException {
        log.info("add response header");
        // servletResponse.setCharacterEncoding("UTF-8");
        servletResponse.setContentType("application/json;charset=UTF-8");

        filterChain.doFilter(servletRequest, servletResponse);
    }
}

